﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LastoRevival.Service.Implementations.Models
{
	class VerificationCode
	{

		public DateTime Expiration { get; private set; }

		public string Code { get; private set; }


		public VerificationCode(string code, DateTime expiration)
		{
			this.Code = code;
			this.Expiration = expiration;
		}

		public static VerificationCode Create()
		{
			var expiration = DateTime.UtcNow.AddDays(3);
			var bytes = Guid.NewGuid().ToByteArray();
			var code = Convert.ToBase64String(bytes);

			return new VerificationCode(code, expiration);
		}



	}
}
